<?php

require_once(WSB_XTENSION_PATH . 'text/models/DbTable/Table.php');

class Test_IndexController extends WSB_Xtension_Content
{
	protected $_noViewRenderer = true;

	public function indexAction()
	{
		$table = $this->getTable();
		$where = $table->getAdapter()->quoteInto('id=?', $this->_container->item_id);
		$row = $table->fetchRow($where);
		if($row instanceof WSB_Db_Row) {
			$html = $row->content;
			if(isset($this->_config->wrap)) {
				$html = $this->_wrap($html, $this->_config->wrap);
			}
			$this->addContent($this->wrapInBaseClass($html));
		}
	}

	public function getTable()
	{
		return new Text_Model_DbTable_Table();
	}

}
